from pymysql import Connection

conn = Connection(
    host='localhost',  # 主机名(IP地址)
    port=3306,  # 端口(默认3306)
    user='root',  # 账户
    password='***'  # 密码
)
print(conn.get_server_info())
cursor = conn.cursor()
conn.select_db("test_with_input")
cursor.execute("select * from test_mysql;")
# 接收表test_mysql的数值
result: tuple = cursor.fetchall()
for x in result:
    print(x)
conn.close()
